/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utilities.entities;

import utilities.*;
import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author olawale
 */
public class DateRange implements Serializable {

    public DateRange(String name, String startDate, String endDate){
        this.name = name;
        this.startDate = startDate;
        this.endDate = endDate;
    }

    public DateRange(String startDate, String endDate){
        this("", startDate, endDate);
    }
    private String startDate;
    private String endDate;
    private String name;

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String range(){
        String range = startDate + " - " + endDate;
        return range;
    }

    public Date [] getDates(){
        Date sd = Utility.parseDate(startDate);
        Date ed = Utility.parseDate(endDate);
        return new Date []{sd, ed};
    }

    public boolean isUnitDate(){
        if(startDate.equals(endDate))
            return true;
        else
            return false;
    }

}
